﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebFormSingTowerMall.HallBooking
{
    public partial class ConfirmBooking : HallBookingBaseController
    {
        protected  override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
            currentPage = "ConfirmBooking.aspx";
            // get the reservation state and set to page controls (if required in your design)
            hallIdlbl.Text = Convert.ToString (bookingDetails.hallId);
            hallNameLbl.Text = Convert.ToString(bookingDetails.hallName);

            eventTitlelbl.Text = bookingDetails.eventTitle;
            startdatelbl.Text = Convert.ToString(bookingDetails.eventStartDate);
            enddatelbl.Text = Convert.ToString(bookingDetails.eventEndDate);
            noOfDaysLbl.Text = Convert.ToString((bookingDetails.eventEndDate.DayOfYear - bookingDetails.eventStartDate.DayOfYear));
            totalAmtLbl.Text = Convert.ToString(bookingDetails.pricePerDay
                                                * (bookingDetails.eventEndDate.DayOfYear - bookingDetails.eventStartDate.DayOfYear)
                                                );

            userfullNamelbl.Text = bookingDetails.userName;
            useridentitylbl.Text = bookingDetails.identityNo;
            cmpnyNamelbl.Text = bookingDetails.cmpnyName;

            bookingDetails.totalPrice = Convert.ToDecimal (bookingDetails.pricePerDay
                                                * (bookingDetails.eventEndDate.DayOfYear - bookingDetails.eventStartDate.DayOfYear)
                                                );
        }



        protected void SubmitBtn_Click1(object sender, EventArgs e)
        {
            ConfirmBooking();
         
               //System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">alert("Hello this is an Alert")</SCRIPT>");
                //System.Web.HttpContext.Current.Response.Write("Hello this is an Alert");
            string script = "alert('Your Event has been sent for Approval');";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
        
            NextPage();
        }
        
    }
}